package com.ganmiao.server.supplier.service;


import com.ganmiao.server.supplier.entity.Supplier;
import com.ganmiao.server.supplier.mapper.SupplierMapper;

public class SupplierService{

    private SupplierMapper supplierMapper;

    public Supplier suppliersGet(Integer id) {
        Supplier suppliers = supplierMapper.suppliersGet(id);
        return suppliers;
    }

    public Integer suppliersInsert(Supplier supplier) {
        int rowsAffected = supplierMapper.suppliersInsert(supplier);
        return rowsAffected;
    }

    public void suppliersUpdate(Integer id, Supplier supplier) {
        supplierMapper.suppliersUpdate(id, supplier.getUser_id(), supplier.getSupplier_name(), supplier.getContacts(), supplier.getTelephone(), supplier.getAddress());
    }

    public void suppliersDelete(Integer id) {
        supplierMapper.suppliersDelete(id);
    }
}
